package com.example.oasystem.dao.mail;

import com.example.oasystem.entity.mail.AoaInMailListOfSun;
import com.example.oasystem.entity.mail.AoaMailnumberOfl;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AoaMailnumberDaoOfl {
    int deleteByPrimaryKey(Long mailNumberId);

    int insert(AoaMailnumberOfl record);

    int insertSelective(AoaMailnumberOfl record);

    AoaMailnumberOfl selectByPrimaryKey(Long mailNumberId);

    int updateByPrimaryKeySelective(AoaMailnumberOfl record);

    int updateByPrimaryKey(AoaMailnumberOfl record);

    List<AoaMailnumberOfl> mailNumbers(@Param("mailNumUserId") Long mailNumUserId,
                                       @Param("baseKey")String baseKey,
                                       @Param("type")Integer type,
                                       @Param("time")Integer time,
                                       @Param("status")Integer status,
                                       @Param("order")String order);
    List<AoaMailnumberOfl> mailNumber(@Param("mailNumUserId") Long mailNumUserId,
                                      @Param("baseKey")String baseKey);

    @Select("delete from aoa_in_mail_list where mail_number_id=#{mailNumberId}")
    int delMailList(@Param("mailNumberId") Long mailNumberId);

    @Select("select * from aoa_in_mail_list where mail_number_id=#{mailNumberId}")
    List<AoaInMailListOfSun>mailList(@Param("mailNumberId") Long mailNumberId);

    @Select("delete from aoa_mail_reciver where mail_id=#{mailId}")
    int delMailReciver(@Param("mailId") Long mailId);

    @Select("delete from aoa_attachment_list where attachment_id=#{attachmentId}")
    int delAttachment(@Param("attachmentId") Long attachmentId);
}